# import requests
#
# def YClogin():
#     unionId='oi5tWwl3O1K6_johy9hECcCQlUx4'  #
#     url='https://uchos-test.perfect99.com/mini/login'
#     data={"unionId":unionId,"loginType":"go"}
#     hearder={'client':'miniapp','Content-Type':'application/json'}
#     resp=requests.post(url=url,headers=hearder,json=data)
#     return resp.json()['data']['accessToken']
import requests


def YC_health_login():
    '''
    获取token并返回
    :return:返回headers
    '''
    unionId='oi5tWwl3O1K6_johy9hECcCQlUx4'  #
    url='https://uchos-test.perfect99.com/mini/login'
    data={"unionId":unionId,"loginType":"go"}
    hearder={'client':'miniapp','Content-Type':'application/json','GW-Client':'test'}
    resp=requests.post(url=url,headers=hearder,json=data)
    token=str('Bearer '+resp.json()['data']['accessToken'])
    #这个函数得到token
    ACCESSTOKEN = 'Bearer ' + token
    HEADERS = {'Authorization': ACCESSTOKEN, 'content_type': 'Application/json','GW-Client':'test'}
    return HEADERS



print(YC_health_login())